package com.example.demo.controller;

import com.example.demo.aop.HelloAnnotation;
import com.example.demo.domain.StudentInfo;
import com.example.demo.service.StudentInfoService;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Tag(name = "hello",description = "hello")
public class HelloController {
    @Autowired
    private StudentInfoService studentInfoService;

    @HelloAnnotation
    @GetMapping("/hello")
    @Operation(description = "hello")
    public String hello(){
        return "hello";
    }


    @Operation(description = "学生信息")
    @GetMapping("/studentInfo")
    public List<StudentInfo> getStudentInfo(){
        return studentInfoService.getAllStudent();
    }

}
